.class Lcom/qiniu/utils/MultipartEntity$FileInfo;
.super Ljava/lang/Object;
.source "MultipartEntity.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/qiniu/utils/MultipartEntity;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = "FileInfo"
.end annotation


# instance fields
.field public mContentType:Ljava/lang/String;

.field public mField:Ljava/lang/String;

.field public mFilename:Ljava/lang/String;

.field public mIsa:Lcom/qiniu/utils/InputStreamAt;

.field final synthetic this$0:Lcom/qiniu/utils/MultipartEntity;


# direct methods
.method public constructor <init>(Lcom/qiniu/utils/MultipartEntity;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/qiniu/utils/InputStreamAt;)V
    .registers 7
    .param p1, "this$0"    # Lcom/qiniu/utils/MultipartEntity;
    .param p2, "field"    # Ljava/lang/String;
    .param p3, "contentType"    # Ljava/lang/String;
    .param p4, "filename"    # Ljava/lang/String;
    .param p5, "isa"    # Lcom/qiniu/utils/InputStreamAt;

    .prologue
    .line 91
    iput-object p1, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 86
    const-string v0, ""

    iput-object v0, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->mField:Ljava/lang/String;

    .line 87
    const-string v0, ""

    iput-object v0, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->mContentType:Ljava/lang/String;

    .line 88
    const-string v0, ""

    iput-object v0, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->mFilename:Ljava/lang/String;

    .line 92
    iput-object p2, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->mField:Ljava/lang/String;

    .line 93
    iput-object p3, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->mContentType:Ljava/lang/String;

    .line 94
    iput-object p4, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->mFilename:Ljava/lang/String;

    .line 95
    iput-object p5, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->mIsa:Lcom/qiniu/utils/InputStreamAt;

    .line 96
    iget-object v0, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->mContentType:Ljava/lang/String;

    if-eqz v0, :cond_25

    iget-object v0, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->mContentType:Ljava/lang/String;

    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v0

    if-nez v0, :cond_29

    .line 97
    :cond_25
    const-string v0, "application/octet-stream"

    iput-object v0, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->mContentType:Ljava/lang/String;

    .line 99
    :cond_29
    return-void
.end method


# virtual methods
.method public length()J
    .registers 5

    .prologue
    .line 102
    iget-object v0, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    # getter for: Lcom/qiniu/utils/MultipartEntity;->fileTpl:Ljava/lang/String;
    invoke-static {v0}, Lcom/qiniu/utils/MultipartEntity;->access$000(Lcom/qiniu/utils/MultipartEntity;)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v0

    add-int/lit8 v0, v0, -0x8

    iget-object v1, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    # getter for: Lcom/qiniu/utils/MultipartEntity;->mBoundary:Ljava/lang/String;
    invoke-static {v1}, Lcom/qiniu/utils/MultipartEntity;->access$100(Lcom/qiniu/utils/MultipartEntity;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/String;->length()I

    move-result v1

    add-int/2addr v0, v1

    int-to-long v0, v0

    iget-object v2, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->mIsa:Lcom/qiniu/utils/InputStreamAt;

    invoke-virtual {v2}, Lcom/qiniu/utils/InputStreamAt;->length()J

    move-result-wide v2

    add-long/2addr v0, v2

    const-wide/16 v2, 0x2

    add-long/2addr v0, v2

    iget-object v2, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->mField:Ljava/lang/String;

    .line 103
    invoke-virtual {v2}, Ljava/lang/String;->getBytes()[B

    move-result-object v2

    array-length v2, v2

    int-to-long v2, v2

    add-long/2addr v0, v2

    iget-object v2, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->mContentType:Ljava/lang/String;

    invoke-virtual {v2}, Ljava/lang/String;->length()I

    move-result v2

    int-to-long v2, v2

    add-long/2addr v0, v2

    iget-object v2, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->mFilename:Ljava/lang/String;

    invoke-virtual {v2}, Ljava/lang/String;->getBytes()[B

    move-result-object v2

    array-length v2, v2

    int-to-long v2, v2

    add-long/2addr v0, v2

    return-wide v0
.end method

.method public writeTo(Ljava/io/OutputStream;)V
    .registers 14
    .param p1, "outputStream"    # Ljava/io/OutputStream;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 107
    iget-object v7, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    # getter for: Lcom/qiniu/utils/MultipartEntity;->fileTpl:Ljava/lang/String;
    invoke-static {v7}, Lcom/qiniu/utils/MultipartEntity;->access$000(Lcom/qiniu/utils/MultipartEntity;)Ljava/lang/String;

    move-result-object v7

    const/4 v8, 0x4

    new-array v8, v8, [Ljava/lang/Object;

    const/4 v9, 0x0

    iget-object v10, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    # getter for: Lcom/qiniu/utils/MultipartEntity;->mBoundary:Ljava/lang/String;
    invoke-static {v10}, Lcom/qiniu/utils/MultipartEntity;->access$100(Lcom/qiniu/utils/MultipartEntity;)Ljava/lang/String;

    move-result-object v10

    aput-object v10, v8, v9

    const/4 v9, 0x1

    iget-object v10, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->mField:Ljava/lang/String;

    aput-object v10, v8, v9

    const/4 v9, 0x2

    iget-object v10, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->mFilename:Ljava/lang/String;

    aput-object v10, v8, v9

    const/4 v9, 0x3

    iget-object v10, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->mContentType:Ljava/lang/String;

    aput-object v10, v8, v9

    invoke-static {v7, v8}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/String;->getBytes()[B

    move-result-object v1

    .line 108
    .local v1, "data":[B
    invoke-virtual {p1, v1}, Ljava/io/OutputStream;->write([B)V

    .line 109
    invoke-virtual {p1}, Ljava/io/OutputStream;->flush()V

    .line 110
    iget-object v7, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    iget-object v8, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    # getter for: Lcom/qiniu/utils/MultipartEntity;->writed:J
    invoke-static {v8}, Lcom/qiniu/utils/MultipartEntity;->access$200(Lcom/qiniu/utils/MultipartEntity;)J

    move-result-wide v8

    array-length v10, v1

    int-to-long v10, v10

    add-long/2addr v8, v10

    # setter for: Lcom/qiniu/utils/MultipartEntity;->writed:J
    invoke-static {v7, v8, v9}, Lcom/qiniu/utils/MultipartEntity;->access$202(Lcom/qiniu/utils/MultipartEntity;J)J

    .line 111
    iget-object v7, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    # getter for: Lcom/qiniu/utils/MultipartEntity;->mNotify:Lcom/qiniu/utils/IOnProcess;
    invoke-static {v7}, Lcom/qiniu/utils/MultipartEntity;->access$300(Lcom/qiniu/utils/MultipartEntity;)Lcom/qiniu/utils/IOnProcess;

    move-result-object v7

    if-eqz v7, :cond_5a

    iget-object v7, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    # getter for: Lcom/qiniu/utils/MultipartEntity;->mNotify:Lcom/qiniu/utils/IOnProcess;
    invoke-static {v7}, Lcom/qiniu/utils/MultipartEntity;->access$300(Lcom/qiniu/utils/MultipartEntity;)Lcom/qiniu/utils/IOnProcess;

    move-result-object v7

    iget-object v8, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    # getter for: Lcom/qiniu/utils/MultipartEntity;->writed:J
    invoke-static {v8}, Lcom/qiniu/utils/MultipartEntity;->access$200(Lcom/qiniu/utils/MultipartEntity;)J

    move-result-wide v8

    iget-object v10, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    invoke-virtual {v10}, Lcom/qiniu/utils/MultipartEntity;->getContentLength()J

    move-result-wide v10

    invoke-interface {v7, v8, v9, v10, v11}, Lcom/qiniu/utils/IOnProcess;->onProcess(JJ)V

    .line 113
    :cond_5a
    iget-object v7, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    invoke-virtual {v7}, Lcom/qiniu/utils/MultipartEntity;->getContentLength()J

    move-result-wide v8

    const-wide/16 v10, 0x64

    div-long/2addr v8, v10

    long-to-int v0, v8

    .line 114
    .local v0, "blockSize":I
    const/high16 v7, 0x40000

    if-le v0, v7, :cond_6a

    const/high16 v0, 0x40000

    .line 115
    :cond_6a
    const/16 v7, 0x4000

    if-ge v0, v7, :cond_70

    const/16 v0, 0x4000

    .line 116
    :cond_70
    const-wide/16 v2, 0x0

    .line 117
    .local v2, "index":J
    iget-object v7, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->mIsa:Lcom/qiniu/utils/InputStreamAt;

    invoke-virtual {v7}, Lcom/qiniu/utils/InputStreamAt;->length()J

    move-result-wide v4

    .line 118
    .local v4, "length":J
    :cond_78
    :goto_78
    cmp-long v7, v2, v4

    if-gez v7, :cond_c2

    .line 119
    int-to-long v8, v0

    iget-object v7, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->mIsa:Lcom/qiniu/utils/InputStreamAt;

    invoke-virtual {v7}, Lcom/qiniu/utils/InputStreamAt;->length()J

    move-result-wide v10

    sub-long/2addr v10, v2

    invoke-static {v8, v9, v10, v11}, Ljava/lang/StrictMath;->min(JJ)J

    move-result-wide v8

    long-to-int v6, v8

    .line 120
    .local v6, "readLength":I
    iget-object v7, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->mIsa:Lcom/qiniu/utils/InputStreamAt;

    invoke-virtual {v7, v2, v3, v6}, Lcom/qiniu/utils/InputStreamAt;->read(JI)[B

    move-result-object v7

    invoke-virtual {p1, v7}, Ljava/io/OutputStream;->write([B)V

    .line 121
    int-to-long v8, v0

    add-long/2addr v2, v8

    .line 122
    invoke-virtual {p1}, Ljava/io/OutputStream;->flush()V

    .line 123
    iget-object v7, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    iget-object v8, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    # getter for: Lcom/qiniu/utils/MultipartEntity;->writed:J
    invoke-static {v8}, Lcom/qiniu/utils/MultipartEntity;->access$200(Lcom/qiniu/utils/MultipartEntity;)J

    move-result-wide v8

    int-to-long v10, v6

    add-long/2addr v8, v10

    # setter for: Lcom/qiniu/utils/MultipartEntity;->writed:J
    invoke-static {v7, v8, v9}, Lcom/qiniu/utils/MultipartEntity;->access$202(Lcom/qiniu/utils/MultipartEntity;J)J

    .line 124
    iget-object v7, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    # getter for: Lcom/qiniu/utils/MultipartEntity;->mNotify:Lcom/qiniu/utils/IOnProcess;
    invoke-static {v7}, Lcom/qiniu/utils/MultipartEntity;->access$300(Lcom/qiniu/utils/MultipartEntity;)Lcom/qiniu/utils/IOnProcess;

    move-result-object v7

    if-eqz v7, :cond_78

    iget-object v7, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    # getter for: Lcom/qiniu/utils/MultipartEntity;->mNotify:Lcom/qiniu/utils/IOnProcess;
    invoke-static {v7}, Lcom/qiniu/utils/MultipartEntity;->access$300(Lcom/qiniu/utils/MultipartEntity;)Lcom/qiniu/utils/IOnProcess;

    move-result-object v7

    iget-object v8, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    # getter for: Lcom/qiniu/utils/MultipartEntity;->writed:J
    invoke-static {v8}, Lcom/qiniu/utils/MultipartEntity;->access$200(Lcom/qiniu/utils/MultipartEntity;)J

    move-result-wide v8

    iget-object v10, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    invoke-virtual {v10}, Lcom/qiniu/utils/MultipartEntity;->getContentLength()J

    move-result-wide v10

    invoke-interface {v7, v8, v9, v10, v11}, Lcom/qiniu/utils/IOnProcess;->onProcess(JJ)V

    goto :goto_78

    .line 126
    .end local v6    # "readLength":I
    :cond_c2
    const-string v7, "\r\n"

    invoke-virtual {v7}, Ljava/lang/String;->getBytes()[B

    move-result-object v7

    invoke-virtual {p1, v7}, Ljava/io/OutputStream;->write([B)V

    .line 127
    invoke-virtual {p1}, Ljava/io/OutputStream;->flush()V

    .line 128
    iget-object v7, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    iget-object v8, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    # getter for: Lcom/qiniu/utils/MultipartEntity;->writed:J
    invoke-static {v8}, Lcom/qiniu/utils/MultipartEntity;->access$200(Lcom/qiniu/utils/MultipartEntity;)J

    move-result-wide v8

    const-wide/16 v10, 0x2

    add-long/2addr v8, v10

    # setter for: Lcom/qiniu/utils/MultipartEntity;->writed:J
    invoke-static {v7, v8, v9}, Lcom/qiniu/utils/MultipartEntity;->access$202(Lcom/qiniu/utils/MultipartEntity;J)J

    .line 129
    iget-object v7, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    # getter for: Lcom/qiniu/utils/MultipartEntity;->mNotify:Lcom/qiniu/utils/IOnProcess;
    invoke-static {v7}, Lcom/qiniu/utils/MultipartEntity;->access$300(Lcom/qiniu/utils/MultipartEntity;)Lcom/qiniu/utils/IOnProcess;

    move-result-object v7

    if-eqz v7, :cond_f9

    iget-object v7, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    # getter for: Lcom/qiniu/utils/MultipartEntity;->mNotify:Lcom/qiniu/utils/IOnProcess;
    invoke-static {v7}, Lcom/qiniu/utils/MultipartEntity;->access$300(Lcom/qiniu/utils/MultipartEntity;)Lcom/qiniu/utils/IOnProcess;

    move-result-object v7

    iget-object v8, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    # getter for: Lcom/qiniu/utils/MultipartEntity;->writed:J
    invoke-static {v8}, Lcom/qiniu/utils/MultipartEntity;->access$200(Lcom/qiniu/utils/MultipartEntity;)J

    move-result-wide v8

    iget-object v10, p0, Lcom/qiniu/utils/MultipartEntity$FileInfo;->this$0:Lcom/qiniu/utils/MultipartEntity;

    invoke-virtual {v10}, Lcom/qiniu/utils/MultipartEntity;->getContentLength()J

    move-result-wide v10

    invoke-interface {v7, v8, v9, v10, v11}, Lcom/qiniu/utils/IOnProcess;->onProcess(JJ)V

    .line 130
    :cond_f9
    return-void
.end method
